<template>
	<div style="margin-top: 60px;">
		<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
			<el-row type="flex" :gutter="10">
			    <el-col :span="12">
			        <el-form-item label="自提地址:" prop="name">
				<el-input v-model="ruleForm.name"></el-input>
			</el-form-item>
			    </el-col>
			</el-row>
			<el-form-item>
				<el-button type="primary" @click="submitForm('ruleForm')">设置</el-button>
				<el-button @click="resetForm('ruleForm')">重置</el-button>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				ruleForm: {
					name: '',
				},
				rules: {
					name: [{
						required: true,
						message: '请输入活动名称',
						trigger: 'blur'
					}, ],
				}
			}
		},
		methods: {
			submitForm(formName) {
				this.$refs[formName].validate((valid) => {
					if (valid) {
						alert('submit!');
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			resetForm(formName) {
				this.$refs[formName].resetFields();
			}
		}
	}
</script>

<style>

</style>
